# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lximage-qt
pkgver=2.0.1
pkgrel=0
pkgdesc="The image viewer and screenshot tool for LXQt"
url="https://github.com/lxqt/lximage-qt"
arch="all !armhf !s390x" # armhf blocked by liblxqt, s390x blocked by libfm-qt
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev qt6-qttools-dev
	libfm-qt-dev libexif-dev menu-cache-dev
	"
options="!check" # No testsuite
subpackages="$pkgname-lang"
source="https://github.com/lxqt/lximage-qt/releases/download/$pkgver/lximage-qt-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
594e86a4bedf3f9689107d79d852ba1ef4db83f06572b8c077ed5850dc10cc05a33fe79a0c05632f7e7541a6f895919b72c264635306f7a468eac6ecde531ba4  lximage-qt-2.0.1.tar.xz
"
